transformJournalForRedis <- function(x){
          x <- transformJournalForGS(x)
          x <- gsub(pattern="\\+", replacement="_", x=x)
          x <- tolower(x)
          return(x)
}

transformJournalForGS <- function(x){
          
          journal <- x
          journal <- gsub(pattern="&amp;", replacement=" ", x=journal)
          journal <- gsub(pattern=":", replacement=" ", x=journal)
          journal <- gsub(pattern="MCP", replacement=" ", x=journal)
          journal <- gsub(pattern="[ ]+", replacement="+", x=journal)
          
          return(journal)
          
}

transformJournalForPubmed <- function(x){
          
          journal <- x
          
          journal <- gsub(pattern="&amp;", replacement=" ", x=journal)
          journal <- gsub(pattern=":", replacement=" ", x=journal)
          journal <- gsub(pattern="[ ]+", replacement=" ", x=journal)
          
          return(journal)
          
}



makeRedisCitationKey <- function(journal, year){
          journal.key <- transformJournalForRedis(journal)
          return(paste(journal.key, year, "citation.list", sep="."))          
}

makeRedisPIDKey <- function(journal, year){
          journal.key <- transformJournalForRedis(journal)
          return(paste(journal.key, year, "pubmedid.list", sep="."))
}


initRedis <- function(){
          redisConnect(host="covm01.ugent.be")
          redisSelect(1)
}

closeRedis <- function(){
          redisClose()
}